Find First Specific Byte in a Byte[] Array c#

Posted by divinci on Stack Overflow See other posts from Stack Overflow or by divinci
Published on 2009-06-10T10:57:30Z Indexed on 2010/06/01 7:13 UTC
Read the original article Hit count: 273

Filed under:
|
|
|

Hi there,

I have a byte array and wish to find the first occurance (if any) of a specific byte.

Can you guys help me with a nice, elegant and efficient way to do it?

 /// Summary
/// Finds the first occurance of a specific byte in a byte array.
/// If not found, returns -1.
public int GetFirstOccurance(byte byteToFind, byte[] byteArray)
{

}

© Stack Overflow or respective owner

Related posts about c#

Related posts about Patterns